package deepbitview

class WalletController {

    static allowedMethods = [save: "POST", update: "POST", delete: "POST"]

    def create = {
        def walletInstance = new Wallet()
        walletInstance.properties = params
        return [walletInstance: walletInstance]
    }

    def save = {
        def walletInstance = new Wallet(params)

        if (walletInstance.save(flush: true)) {
            flash.message = "${message(code: 'default.created.message', args: [message(code: 'wallet.label', default: 'Wallet'), walletInstance.id])}"
            redirect(controller: "overview", action: "index")
        }
        else {

            log.info(walletInstance.errors)
            render(view: "create", model: [walletInstance: walletInstance])
        }
    }

}
